home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4832 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: void main() and other atrocities!
  5. Date: 06 Feb 1996 04:56:06 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb5215606@qcd.lanl.gov>
  8. References: <4eduaj$1aq@grouper.Exis.Net> <4em17r$shq@jaxnet.jaxnet.com>
  9.     <4emub9$1mo@fountain.mindlink.net> <4epplj$egf@host-3.cyberhighway.net>
  10.     <4erjn2INN38b@keats.ugrad.cs.ubc.ca>
  11.     <9602021300.AA04359@dxmint.cern.ch>
  12.     <4f5vc2$qcj@cdn_news.telecom.com.au>
  13. NNTP-Posting-Host: qcd.lanl.gov
  14. Mime-Version: 1.0
  15. Content-Type: text
  16. In-reply-to: jolson@vprpmel1.telecom.com.au's message of Tue, 06 Feb 96 19:11:31 GMT
  17.  
  18. In article <4f5vc2$qcj@cdn_news.telecom.com.au>
  19. jolson@vprpmel1.telecom.com.au (Jeff Olson) writes: 
  20.    How about:
  21.  
  22.    int main (int argc, char **argv)
  23.  
  24.    I saw in the FAQ that a multi-dimentional array will not decay into
  25. a pointer  
  26.    to a pointer.  This main() is valid with my Sparcworks compiler so
  27. I would  
  28.  
  29.  
  30. argv is not a multidimensional array, you can think of main as being
  31. called with a parameter that is an array of pointers which decays
  32. in the normal fashion to a pointer to pointer. 
  33.  
  34. As an array almost always decays to a pointer in a parameter list, an
  35. object declared as an array in a parameter list is declared as a
  36. pointer itself. Thus, char *argv[] and char **argv are equivalent in
  37. the prototype of main.
  38.  
  39. Cheers
  40. Tanmoy
  41. --
  42. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  43. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  44. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  45. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  46. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  47. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  48.